Package MusicLandscape.util.comparators
Class MyTitleComparator
- java.lang.Object
-
- MusicLandscape.util.comparators.MyTrackComparator
-
- MusicLandscape.util.comparators.MyTitleComparator
-
public class MyTitleComparator extends MyTrackComparator
This class represents the concept of comparison of two track by title.- Since:
- ExerciseSheet04
- Version:
- 1
- Author:
- Jonas Altrock (ew20b126@technikum-wien.at)
-
-
Constructor Summary
Constructors Constructor Description MyTitleComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Track t1, Track t2)Compares two tracks by title.
-
-
-
Method Detail
-
compare
public int compare(Track t1, Track t2)
Compares two tracks by title. Comparison is performed lexicographically on the titles of the two tracks. This comparator does not handle null tracks.- Specified by:
comparein classMyTrackComparator- Parameters:
t1- the one track to comparet2- the other track to which t1 is to be compared- Returns:
- a measure of the distance between t1 and t2 in the sense of the comparator
-
-